﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ExcellOnServices.Models
{
    public partial class Account
    {
        public static Accounts_Company GetCompanyInfo(int id)
        {
            using (ExcellOnServicesContext db = new ExcellOnServicesContext())
            {
                Account account = db.Accounts.Find(id);
                Accounts_Company account_company = account.Accounts_Company;
                return account_company;
            }
        }
        public static Accounts_Admin GetAdminInfo(int id)
        {
            using (ExcellOnServicesContext db = new ExcellOnServicesContext())
            {
                Account account = db.Accounts.Find(id);
                Accounts_Admin account_admin = account.Accounts_Admin;
                return account_admin;
            }
        }

        public static bool isAdmin(int id)
        {
            using (ExcellOnServicesContext db = new ExcellOnServicesContext())
            {
                Account account = db.Accounts.Find(id);
                if (account.Accounts_Admin == null)
                    return false;
                else
                    return true;
            }
        }
    }
}